/*
 * Te_Login_View.java
 *
 * Created on 2009年2月23日, 下午11:05
 */

package view;

import model.UserID_Model;
import ucm.Card_UC;
import ucm.Setting_UC;

/**
 *
 * @author  马凯
 */
public class Te_Login_View extends javax.swing.JFrame {
    
    /** Creates new form Te_Login_View */
    public Te_Login_View() {
        this.setSize(800, 600);
        initComponents();
        this.setLocationRelativeTo(null);
        
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLayeredPane1 = new javax.swing.JLayeredPane();
        background_La = new javax.swing.JLabel();
        userID_TF = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("ISC_SING IN");

        background_La.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\马凯\\桌面\\Main副本.jpg")); // NOI18N
        background_La.setLabelFor(this);
        background_La.setBounds(-10, 0, 800, 600);
        jLayeredPane1.add(background_La, javax.swing.JLayeredPane.PALETTE_LAYER);

        userID_TF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userID_TFActionPerformed(evt);
            }
        });
        userID_TF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                userID_TFKeyPressed(evt);
            }
        });
        userID_TF.setBounds(10, 30, 171, 21);
        jLayeredPane1.add(userID_TF, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 789, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 600, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void userID_TFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userID_TFActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_userID_TFActionPerformed

    private void userID_TFKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_userID_TFKeyPressed
        if((evt.getKeyCode()==13||evt.getKeyCode()==10)&&this.userID_TF.getText().length()==10){
            Card_UC.getInstance(this).run();
        }else{
            this.userID_TF.setText("");
        }
}//GEN-LAST:event_userID_TFKeyPressed
    
    public UserID_Model getIDModel(){
        UserID_Model um = new UserID_Model();
        um.setUserID(this.userID_TF.getText());
        return um;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Te_Login_View().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel background_La;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JTextField userID_TF;
    // End of variables declaration//GEN-END:variables
    
}
